<template>
    <fragment>
        <template v-for="menu in menus">
            <el-submenu v-if="menu.children && menu.children.length >= 1" :index="menu.menuId + ''" :key="menu.menuId">
                <template slot="title">
                    <i :class="menu.icon"></i>
                    <span slot="title">{{menu.menuName}}</span>
                </template>
                <z-menu :menus="menu.children"></z-menu>
            </el-submenu>
            <el-menu-item v-else :index="menu.menuId + ''" @click="handleRouter(menu)" :key="menu.menuId">
                <i :class="menu.icon"></i>
                <span slot="title">{{menu.menuName}}</span>
            </el-menu-item>
        </template>
    </fragment>
</template>

<script>
export default {
    name: "zMenu"
}
</script>

<style scoped>

</style>
